﻿<nav>
@{
    var lnode = ViewBag.Layout.CurrentMobileNode;
    var cnodes = ViewBag.Layout.CurrentMobileNode.ChildNodes;
    if (ViewBag.Layout.CurrentMobileNode.ChildNodes.Count == 0)
    {
        lnode = ViewBag.Layout.CurrentMobileNode.ParentNode;
        cnodes = ViewBag.Layout.CurrentMobileNode.ParentNode.ChildNodes;
        
        <div data-role="collapsible" data-collapsed="true">
            <h3>More in this section</h3> 
            <ul data-role="listview" data-inset="true">
            @foreach (var n in cnodes)
            {
                <li><a href="@n.Url">@n.Title</a></li>
            }
            </ul>
        </div>
    }
    else
    {
        <ul data-role="listview" data-inset="true">
        @foreach (var n in cnodes)
        {
            <li><a href="@n.Url">@n.Title</a></li>
        }
        </ul>
    }
}
</nav>
